home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr05
/
ew120.zip
/
FILES1.ZIP
/
EWAPI.SUP
< prev
next >
Wrap
Text File
|
1993-05-02
|
8KB
|
201 lines
This file contains additions or modifications made to the original
EW API documentation distributed to the registered users of previous
versions. New users will receive an updated documentation. So, if
you don't already have a copy of the API documentation, you don't
need to keep this file on your disk.
********************************************************************
EW API 1.1 ADDITIONAL INFORMATION AND CORRECTIONS
********************************************************************
WARNING !! The following modifications mean that existing EWDs must be
be recompiled. We provide updated versions of previous EWDs but you'll
have to recompile your own Extension DLLs.
EWExecute now takes a WORD parameter
************************************
The following has been added to section 2.1
EWExecute parameter:
EWExecute accepts a single parameter of type WORD. This parameter is called
the RoutineId and is the basic component of the Menu Dispatching feature.
The ANSIOEM sample EWD is a good example of how to use the Menu Dispatching
feature. This EWD implements the conversion of text from ANSI to OEM or from
OEM to ANSI. Since these functions are quite similar it would be rather
inefficient to write two different DLLs to do this job. However, an EWD has
a single entry point which is EWExecute. Also, what if the EWD author wants
to add two different entries in the User Menu if only one entry point exists
in the EWD?
The RoutineId is a simple way to do Menu Dispatching and to specify which
subroutine within the EWD has to be executed when a specific command has been
selected from the User Menu.
The EWAddMenuEntry function now accepts an additional parameter, defined by
the EWD author: the RoutineId. This WORD value will be stored with the other
relevant data making up the User Menu entry. When the user selects that
item in the User Menu, E! will call EWExecute, passing it the relevant
RoutineId. This way, the EWD will be able to know which command has been
choosen by the user.
The Key Assignment dialog box and the User Menu Definition dialog box also
allow to define a RoutineId when assigning an EWD to a key or a Menu Item.
By default, E! sets this value to 0.
ANSIOEM.EWD uses this feature to determine whether the user wants to
translate from ANSI to OEM or from OEM to ANSI. ANSIOEM installs two entries
in the User Menu: "Convert to OEM" (RoutineId = 1) and "Convert to ANSI"
(RoutineId = 2). When EWExecute is called, ANSIOEM checks the value passed by
E!. If it is equal to 0, this means that the command has been triggered from
the "Execute User Extension" dialog box. In that case, a message box is
displayed, prompting the user for a choice. Otherwise, it knows which kind
of translation has to be done.
The EWD author using the RoutineId feature has to let the user know which
RoutineIds are used to trigger which functions. This way, the user will be
able to assign these functions to a key.
Please read the code of ANSIOEM.PAS to fully understand how the RoutineId
parameter can be used.
Section 3.1 has been changed to reflect the new EWExecute function:
TExecFunc = function(MenuId : word) : integer;
int (FAR PASCAL* TExecFunc)(unsigned int MenuId);
General form of the EWExecute function called when execution of the
EWD has been requested by the user.
The EWAddMenyEntry function has been changed accordingly:
function EWAddMenuEntry(Command, Title : PChar;
RoutineId : word;
AssignMode : word
RoutineId : word) : longint;
long FAR PASCAL EWAddMenuEntry(char FAR* Command,
char FAR* Title,
unsigned int RoutineId,
unsigned int AssignMode
unsigned int RoutineId);
This function adds an entry in the User Menu. This entry will appear in all
User Menus but will not be saved along with the user items. Normally, this
function will be called once in the initialization part of an active EWD if
you want the EWD to insert itself automatically in the user menu. See
COUNTER.EWD.
Command Command to be executed when the user selects the menuitem.
The meaning of the Command string depends on the assignment
mode. It is ignored if AssignMode is equal to
EWAssign_Command.
Title Text of the menu item appearing in the User Menu.
CommandId This value is used only if the AssignMode is equal to
EWAssign_Command. In that case, Command will be ignored and
CommandId will be the code of an editing function. These codes
are defined in EWUSER.INC and EWAPI.H.
AssignMode May take one of the following value
EWAssign_Program Command = DOS or WINDOWS command
EWAssign_Command CommandId = editing function code
EWAssign_Macro Command = 8 character macro name
EWAssign_Extension Command = 8 character extension name
(EWD)
RoutineId This is a programmer defined value that will be passed to
EWExecute whenever the user selects this menu entry. Please
see the discussion about RoutineIds in the EWExecute section.
ANSIOEM.EWD uses the RoutineId to do Menu Dispatching.
Return Value:
The function returns a long that can be used as the new menu item
identifier. This identifier will be needed when using the EWRemoveMenuEntry
function. If the function fails, it returns -1.
_______________________________________________________________________________
The following functions were added to the API:
function EWGetInstance : word;
unsigned int FAR PASCAL EWGetInstance(void);
Give the instance handle of EW.
Return Value:
The function returns the instance handle of the running copy of E! allowing
the extension DLL to register window procedures.
_______________________________________________________________________________
function EWGetTextWindowHandle : word;
unsigned int FAR PASCAL EWGetTextWindowHandle(void);
Give the handle of the active Text Window. The Text Window is a child window
of the Edit Window. The Edit Window client area contains several child
windows: the Ribbon, the Text Window and the Status Windows. The Text Window
also has a child window which is named the Control Area.
Return Value:
The function returns the handle of the current Text Window. If this value is
null, there's no active window.
_______________________________________________________________________________
procedure EWSetModified; export;
void FAR PASCAL EWSetModified(void);
Set the "text modified" flag of the current Editor. Use this function when
you have changed the current text directly without using an editing
function. Failing to do so will prevent E! from recognizing the change and
will allow exiting the editor without saving the file.
********************************************************************
EW API 1.2 ADDITIONAL INFORMATION AND CORRECTIONS
********************************************************************
_______________________________________________________________________________
function EWIsModified; export;
unsigned int FAR PASCAL EWIsModified(void);
Retrieve the "text modified" flag of the current Editor. Use this function
to know whether the current text has been modified. The function will return
0 if the text has not been modified and a non null value otherwise.
_______________________________________________________________________________
EWGlbRepaint and EWGlbStripJoin Global Flags
********************************************
Two additional global option flags are now supported:
EWGlbRepaint: this flag defines which method will be used to refresh the text
window when scrolling.
EWGlbStripJoin: this flag specifies whether trailing and leading spaces will
be stripped when joining lines (the JoinLine routine is also used when
deleting text marked in Stream mode).
EWLclbAutoIndent Local Flag
***************************
This new Local flag allows to toggle the AutoIndent feature.